import request from '@/utils/request'
// import { makeFormData } from '@/utils/util'

const api = {
  list: 'web/live_room/cameraList',
  info: 'web/live_room/detail',
  delete: 'web/live_room',
  add: 'web/live_room/add',
  getStatus: 'web/live_room/get_liveroom_switch',
  setStatus: 'web/live_room/set_liveroom_switch'
}

export function getList (params = {}) {
  return request({
    url: api.list,
    method: 'post',
    params
  })
}

export function getInfo (params = {}) {
  return request({
    url: api.info,
    method: 'post',
    params
  })
}

export function getStatus (params = {}) {
  return request({
    url: api.getStatus,
    method: 'get',
    params
  })
}

export function setStatus (params = {}) {
  return request({
    url: api.setStatus,
    method: 'post',
    params
  })
}

export function addSubmit (params = {}) {
  return request({
    url: api.add,
    method: 'post',
    params
  })
}

export function deleteCamera (params = {}) {
  return request({
    url: `web/live_room/${params.liveRoomId}`,
    method: 'delete',
    params
  })
}

export function openCamera (params = {}) {
  return request({
    url: `web/live_room/open_live`,
    method: 'post',
    params
  })
}

export function closeCamera (params = {}) {
  return request({
    url: `web/live_room/close_live`,
    method: 'post',
    params
  })
}

export function updateCamera (params = {}) {
  return request({
    url: `web/live_room/update_date`,
    method: 'post',
    params
  })
}

